package com.yunhe.policyfulfillment.policyful.repository;

import com.yunhe.policyfulfillment.policyful.domain.Appeal;
import com.yunhe.policyfulfillment.policyful.model.AppealCondition;
import com.yunhe.policyfulfillment.policyful.model.AppealVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @ClassName: AppealRepository
 * @Description:
 * @author: GongDaCheng
 * @Date: 14:36 2021/8/24
 */
@Repository
public interface AppealRepository {

    /**
     * @Description 新增诉求
     * @Param Appeal appeal
     * @Return int
     * @Date 2021/8/24 14:38
     */
    int createAppeal(Appeal appeal);

    /**
     * @Description 删除诉求
     * @Param int id
     * @Return int
     * @Date 2021/8/24 14:38
     */
    int deleteAppeal(@Param("id") int id);

    /**
     * @Description 更新诉求
     * @Param Appeal appeal
     * @Return int
     * @Date 2021/8/24 14:40
     */
    int updateAppeal(Appeal appeal);

    /**
     * @Description 根据id查询Appeal
     * @Param int id
     * @Return Appeal
     * @Date 2021/8/24 14:41
     */
    Appeal findAppealById(@Param("id") long id);

    /**
     * @Description 获取当前年度诉求总量
     * @Param Date startTime, Date endTime
     * @Return int
     * @Date 2021/8/24 17:38
     */
    int getAnnualTotalCount(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    /**
     * @Description 获取当前年度已处理诉求条数
     * @Param Date startTime, Date endTime
     * @Return int
     * @Date 2021/8/25 9:42
     */
    int getAnnualHandledCount(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    /**
     * @Description 获取当前年度未处理诉求条数
     * @Param Date startTime, Date endTime
     * @Return int
     * @Date 2021/8/25 9:50
     */
    int getAnnualUntreated(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    /**
     * @Description 根据条件筛选诉求
     * @Param AppealCondition appealCondition
     * @Return List<Appeal>
     * @Date 2021/8/25 14:07
     */
    List<Appeal> getAppealByCondition(AppealCondition appealCondition);

    /**
     * @Description 根据条件筛选诉求Portal
     * @Param AppealCondition appealCondition
     * @Return List<Appeal>
     * @Date 2021/8/30 11:31
     */
    List<Appeal> getAppealByConditionPortal(AppealCondition appealCondition);
    
    /**
     * @Description 公开诉求
     * @Param long id
     * @Return
     * @Date 2021/8/25 18:00
     */
    void publicAppeal(@Param("id") long id);

    /**
     * @Description 根据部门id获取部门名
     * @Param long handleOrg
     * @Return String
     * @Date 2021/8/27 10:42
     */
    String getOrgTitle(@Param("handleOrg") long handleOrg);
}
